import React, { useState } from 'react';
import useDebounceFn from './index';
export default () => {
    const [value, setValue] = useState(0)
    const { run } = useDebounceFn(
        () => {
            setValue(value + 1)
        },
        {
            wait: 500
        }
    )
    return (
        <div>
            <p style={{ marginTop: 16 }}> Clicked count: {value} </p>
            <button type="button" onClick={run}>
                Click fast!
            </button>
        </div>
    )
}